//
// Created by superzou on 2019/11/5.
//

#ifndef PAINT_LINESHADOW_H
#define PAINT_LINESHADOW_H




#include <memory>
#include <opencv2/core.hpp>
#include <filesystem>
using std::filesystem::path;
class QPoint;
class ImageManager;


const cv::Scalar SHADOW=cv::Scalar(128, 128, 128);
const cv::Scalar SHADOW_FREE = cv::Scalar(255, 255, 255);

class LineShadow {

public:

    const static int ON_CLICK = 0 ;
    const static int ON_MOVING = 1;
    const static int ON_RELEASE = 2;

    explicit LineShadow();

    void addImages(const cv::Mat&img);
    void clearImages();

    void addPoint(const cv::Point& pos) ;
    void addPoint(const QPoint& pos) ;
    void draw(int x, int y, const cv::Scalar& color, int flag);

    void saveImages(const path& dir, const path& imageName);
    cv::Mat getMask();
    cv::Mat getOrigin();

private:
    void drawOnClick(const cv::Scalar& color);
    void drawOnMove(const cv::Scalar& color);
    void drawOnRelease(const cv::Scalar& color);


    void clearPoints();
    void printPoints();

private:
    //
    std::shared_ptr<ImageManager> imageManager;

};


#endif //PAINT_LINESHADOW_H
